import React from 'react';
import PropTypes from 'prop-types'
// import MediaQuery from 'react-responsive';
import { observer, inject } from 'mobx-react'
import { StateClass } from './store/app_state'

@inject('appState') @observer
class PcIndex extends React.Component {
  constructor() {
    super()
    this.state = {
      count: 1,
    }
  }
  componentWillMount() {
    this.setState({
      count: 33,
    })
  }
  componentDidMount() {
  }
  setStateAsync(state) {
    return new Promise((resolve) => {
      this.setState(state, resolve)
    });
  }
  asyncBootstrap() {
    return new Promise((resolve) => {
      this.props.appState.count = 10
      resolve(true)
    })
  }
  render() {
    return (
      <div id="pc">{this.props.appState.count}---{this.state.count}</div>
    )
  }
}
export default PcIndex
PcIndex.propTypes = {
  appState: PropTypes.instanceOf(StateClass),
}
